package com.zl.hyzg.controller;

import com.zl.hyzg.domain.Member;
import com.zl.hyzg.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/member")
public class MemberController {
    @Autowired
    private MemberService memberService;
    @PostMapping("/add")
    public String addMember(@RequestBody Member member){
        System.out.println(member);
        int result = memberService.addMember(member);
        if(result==1){
            return "success";
        }else{
            return "fail";
        }
    }
}
